<%@ include file="/WEB-INF/jsp/taglib.jsp" %>

<%@ page buffer="16kb"%>
<% pageContext.setAttribute("timezone", "Australia/Victoria"); %>


<jsp:useBean id="actionBean" scope="request" type="org.brownflat.lighthouse.web.HomeAction" />

<s:layout-render name="/WEB-INF/jsp/layout.jsp" title="${app.title}" subtitle="Home">
     <s:layout-component name="body">

        <table width="100%">
            <tr>
                <td bgcolor="${actionBean.currentlyBroken ? "red" : "green"}">&nbsp;</td>
            </tr>
        </table>

        <display:table name="actionBean.allTasks" id="task" requestURI="Home.action" class="rounded-corner">
            <display:column title="Server" property="monitorable.name"/>
            <display:column title="URL" property="monitorable.location"/>
            <display:column title="Active" property="active"/>
            <display:column title="Current Broken Builds?" property="monitorable.broken"/>
        </display:table>

        <table width="100%">
        <tr>
        <td><a href="Status.action">Status</a> - <a href="Stats.action">Stats</a>- <a href="ManualDevice.action">Reset Light</a></td>
        </tr>
        </table>

        <p>&nbsp;</p>
        <display:table export="true" pagesize="100" defaultorder="descending" defaultsort="6" name="actionBean.builds" id="build" requestURI="Home.action" class="rounded-corner">
            <display:setProperty name="export.excel.filename" value="builds.xls"/>
            <display:setProperty name="export.csv.filename" value="builds.csv"/>
            <display:setProperty name="export.excel" value="true"/>
            <display:setProperty name="export.csv" value="true"/>
            <display:setProperty name="export.xml" value="false"/>
            <display:setProperty name="export.excel.include_header" value="true"/>
            <display:column title="Key">
                <span alt="${build.rawData}">${build.buildKey}</span>
            </display:column>
            <display:column title="Project" property="project"/>
            <display:column title="Build" property="name"/>
            <display:column title="Build No" property="buildNumber"/>
            <display:column title="Broken?" property="broken"/>
            <display:column title="Date" property="date" decorator="org.brownflat.lighthouse.web.DateTimeDecorator"/>
        </display:table>

    </s:layout-component>
</s:layout-render>